package com.shaozi.nc.visitors;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.shaozi.data.mq.business.info.UserInfo;
import com.shaozi.nc.data.model.UserInfoModel;
import com.shaozi.nc.manage.CompanyUserInfoManage;

@Component
public class UserInfoVisitor implements UserInfo {

	@Autowired
	private CompanyUserInfoManage userInfoMgr;

	public UserInfoVisitor() {

	}

	@Override
	public String getUsername(String companyId, String uid) {
		UserInfoModel userInfo = userInfoMgr.getUserInfo(companyId, uid);
		if (userInfo == null)
			return null;
		return userInfo.getUsername();
	}

}
